package com.neuedu.opp03ex;

public class LiteratureStudent extends Student {
    /**
     * 演讲成绩
     */
    private double speech;
    /**
     * 作品成绩
     */
    private double works;

    /**
     * 空参构造
     */
    public LiteratureStudent() {
    }

    /**
     * 全参构造
     */
    public LiteratureStudent(String stuId, String name, String gender, int age,
                             double midTermExam, double finalExam, double speech, double works) {
        super(stuId, name, gender, age, midTermExam, finalExam);
        this.speech = speech;
        this.works = works;
    }

    /**
     * get和set方法
     */
    public double getSpeech() {
        return speech;
    }

    public void setSpeech(double speech) {
        this.speech = speech;
    }

    public double getWorks() {
        return works;
    }

    public void setWorks(double works) {
        this.works = works;
    }

    /**
     * 重写获取综合成绩的方法
     * @return
     */
    @Override
    public double score() {
        return (this.speech * 0.35 + this.works * 0.35
                + this.midTermExam * 0.15 + this.finalExam * 0.15);
    }
}
